package July;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Day0726 {
    /**
     * 查找输入整数二进制中1的个数
     * @param args
     */
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()){
            int n = scanner.nextInt();
            int count = 0;
            //将十进制转为二进制
            String str = Integer.toString(n,2);

            char[] chars = str.toCharArray();

            for (int i = 0; i < chars.length; i++) {
                if (chars[i] == '1'){
                    count++;
                }
            }
            System.out.println(count);
        }
    }


    /**
     * 手套
     * @param n  手套颜色
     * @param left  左手手套数组
     * @param right 右手手套数组
     * @return  至少拿多少双保证颜色一样
     */
    public int findMinimum(int n, int[] left, int[] right) {
        int left_nums = 0;
        int right_nums = 0;
        int left_min = Integer.MAX_VALUE;
        int right_min = Integer.MAX_VALUE;
        int sum = 0;

        for (int i = 0; i < n; i++) {
            if (left[i] * right[i] == 0)
                sum += left[i]+right[i];
            else {
                left_nums += left[i];
                left_min = Math.min(left_min,left[i]);

                right_nums += right[i];
                right_min = Math.min(right_min,right[i]);
            }
        }
        int res = Math.min(left_nums-left_min+1,right_nums-right_min+1);

        return sum + res+1;
    }
}
